<template>
	<view>
		<carHeader :title="'已完成订单'"></carHeader>
		<view class="top">
			<view class="top-top">
				<view class="top-one">
					订单信息
					<view class="success">
						已完成
					</view>
				</view>
				<view class="top-two">
					<p>订单号：{{details.ordNumber}}</p>
					<p>服务项目：{{details.proName}}</p>
					<p>服务门店：{{details.proName}}
						<image src="../../static/车联网服务商家端-06维修任务-详情1_slices/plane.png"></image>
					</p>
					<p>下单时间：{{details.createTime}}</p>
					<p>预约时间：{{details.bookingTime}}</p>
					<p>车辆：{{details.type}}</p>
					<p>备注：{{details.remark}}</p>
				</view>
			</view>
			<view class="top-center">
				<view class="center-one">
					订单详情
				</view>
				<view class="center-two">
					<p><span>车辆精洗</span>
						<span><span v-if="useMoney > 0">￥</span>{{details.couShopDiscounts}}</span>
					</p>
					<p><span>车辆附加费用</span>
						<span><span v-if="otherMoney > 0">￥</span>{{details.couShopDiscounts}}</span>
					</p>
				</view>
				<view class="center-three">
					<p><span>原价</span>
						<span><span v-if="fisrtMoney > 0">￥</span>{{details.oldPrice}}</span>
					</p>
					<p><span>店家优惠</span>
						<span class="money1"><span v-if="reduceMoney > 0">-￥</span>{{details.couShopDiscounts}}</span>
					</p>
				</view>
				<view class="center-four">
					<p><span>优惠券</span>
						<span class="money1"><span v-if="coupon > 0">-￥</span>{{details.couPreferentialMoney}}</span>
					</p>
				</view>
				<view class="center-five">
					<p><span>支付金额</span>
						<span class="money2"><span
								v-if="(fisrtMoney - reduceMoney - coupon) > 0">￥</span>{{details.ordActualPrice}}</span>
					</p>
				</view>
			</view>

		</view>
		<view class="bottom">
			<view class="bottom-top">
				评价结果
			</view>
			<view class="bottom-bottom">
				<p>评价时间：{{details.createTime}}分</p>
				<p class="socre"><span>评价结果：{{details.starRating}}</span>
					<view class="star" v-for="(i, indexInner) in details.starRating" :key="indexInner">
						<u-icon name="star-fill" color="#ffc100">
						</u-icon>
					</view>
				</p>
				<p>评语：{{details.comment}}</p>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				/* / */
				details:[],
			}
		},
		methods: {
			

		},
		onLoad(options) {
		      console.log(2222222);
		      console.log(options.data);
		      if (options.data) {
		        try {
		          // 解码并解析传入的数据
		          const decodedData = decodeURIComponent(options.data);
		          this.details = JSON.parse(decodedData).rows[0];
		          console.log('评价详情:', this.details);
		        } catch (error) {
		          console.error('解析数据错误:', error);
		          // 如果解析失败，可以在这里提供备用处理逻辑
		        }
		      }
		    }
	}
</script>

<style lang="scss">
	.top {
		position: relative;
		top:-240rpx;
		background-color: #fff;
		border-radius: 50rpx;
		margin: 0 20rpx 20rpx;
		padding: 30rpx;

		.top-top {
			padding: 10rpx;

			.top-one {
				padding-bottom: 20rpx;
				font-size: 36rpx;
				border-bottom: 5rpx solid #f5f5f5;

				.success {
					display: inline-block;
					color: #f00;
					font-size: 24rpx;
					position: relative;
					left: 380rpx;
				}
			}

			.top-two {
				margin-top: 20rpx;
				font-size: 24rpx;
				margin-bottom: 40rpx;

				image {
					margin-left: 20rpx;
					width: 20rpx;
					height: 20rpx;
				}

				p {
					margin-top: 10rpx;
				}
			}
		}

		.top-center {
			padding: 10rpx;

			p {
				margin-top: 15rpx;
				display: flex;
				justify-content: space-between;
			}

			.center-one {
				font-size: 36rpx;
				padding-bottom: 20rpx;
				font-size: 36rpx;
				border-bottom: 5rpx solid #f5f5f5;

			}

			.center-two {
				margin: 20rpx 0;
				padding-bottom: 20rpx;
				border-bottom: 2rpx solid #f5f5f5;
			}

			.center-three {
				margin: 20rpx 0;
				padding-bottom: 20rpx;
				border-bottom: 2rpx solid #f5f5f5;

				.money1 {
					color: #f00;
				}
			}

			.center-four {
				margin: 20rpx 0;
				padding-bottom: 20rpx;
				border-bottom: 5rpx solid #f5f5f5;

				.money1 {
					color: #f00;
				}
			}

			.center-five {
				margin: 20rpx 0;
				padding-bottom: 20rpx;
				border-bottom: 2rpx solid #f5f5f5;

				.money2 {
					font-weight: 550;
					font-size: 36rpx;
				}
			}
		}
	}

	.bottom {
		position: relative;
		top:-230rpx;
		background-color: #fff;
		border-radius: 50rpx;
		margin: 0 20rpx 20rpx;
		padding: 30rpx;
		
		.bottom-top {

			font-size: 36rpx;
			padding-bottom: 20rpx;
			font-size: 36rpx;
			border-bottom: 5rpx solid #f5f5f5;

		}

		.bottom-bottom {
			margin-top: 20rpx;
			p {
				margin-top: 15rpx;
			}
			.star {
				display: inline-block;
			}
		}
	}
</style>